#pragma once

#include "sqlite3.h"
#include "CriticalSectionEx.h"

class CDataHandler
{
public:
    CDataHandler(const char* filename);
    ~CDataHandler(void);

    int Execute(const char* sql);
    int Query( const CString& sql, char *** azResult, int* nRow, int* nColumn );
    sqlite3_stmt *Prepare(const char* sql);
private:
    sqlite3* m_pDatabase;
    CCriticalSectionEx m_criticalSection;
};
